<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="DiaEditDlg" widgetVar="DiaEditDialog" modal="true" resizable="false" appendToBody="true" header="#{bundle.EditDiaTitle}">

            <h:form id="DiaEditForm">

                <h:panelGroup id="display">
                    <p:panelGrid  columns="2" rendered="#{diaController.selected != null}">

                        <h:outputLabel value="#{bundle.EditDiaLabel_diaPK_fecha}" for="diaPK_fecha" />
                        <h:outputText id="diaPK_fecha" value="#{diaController.selected.diaPK.fecha}" />

                        <h:outputLabel value="#{bundle.EditDiaLabel_observacion}" for="observacion" />
                        <p:inputText id="observacion" value="#{diaController.selected.observacion}" title="#{bundle.EditDiaTitle_observacion}" />

                        <h:outputLabel value="#{bundle.EditDiaLabel_estadoidEstado}" for="estadoidEstado" />
                        <p:selectOneMenu id="estadoidEstado" value="#{diaController.selected.estadoidEstado}" required="true" requiredMessage="#{bundle.EditDiaRequiredMessage_estadoidEstado}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{estadoController.items}"
                                           var="estadoidEstadoItem"
                                           itemValue="#{estadoidEstadoItem}"
                                           itemLabel="#{estadoidEstadoItem.descripcion.toString()}"
                                           />
                            <f:converter binding="#{estadoConverter}"/>
                        </p:selectOneMenu>

                        <h:outputLabel value="#{bundle.EditDiaLabel_turnoidTurno}" for="turnoidTurno" />
                        <p:selectOneMenu id="turnoidTurno" value="#{diaController.selected.turnoidTurno}" required="true" requiredMessage="#{bundle.EditDiaRequiredMessage_turnoidTurno}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{turnoController.items}"
                                           var="turnoidTurnoItem"
                                           itemValue="#{turnoidTurnoItem}"
                                           itemLabel="#{turnoidTurnoItem.descripcion.toString()}"
                                           />
                            <f:converter binding="#{turnoConverter}"/>
                        </p:selectOneMenu>

                        <h:outputLabel value="#{bundle.EditDiaLabel_empleado}" for="empleado" />
                        <h:outputText id="empleado" value="#{diaController.selected.empleado.idEmpleado}"/>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{diaController.save}" value="#{bundle.Save}" update="display,:DiaListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,DiaEditDialog);"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="DiaEditDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
